package com.example.noelwhereismystuffs.presenters;

import java.util.List;

import com.example.noelwhereismystuffs.models.IModel;
import com.example.noelwhereismystuffs.models.Item;
import com.example.noelwhereismystuffs.models.User;
import com.example.noelwhereismystuffs.views.DisplayLostItemsActivity.IDisplayLostItemsView;

public class DisplayLostItemsPresenter {
	private IModel myModel;
	private IDisplayLostItemsView myView;
	private static User myUser = User.NULL_USER;

	/**
	 * Constructor
	 * 
	 * @param model
	 * @param view
	 * @param user
	 */
	public DisplayLostItemsPresenter(IModel model, IDisplayLostItemsView view,
			User user) {
		myModel = model;
		myView = view;
		this.myUser = user;
		if (myModel.getLostItems(user) != null) {
			myView.setLostItemsList(myModel.getLostItems(user));
		}
	}

	public void filtStatus(String status) {
		List<Item> itemList = myModel.filtStatus(myUser, status);
		myView.advanceFilter(itemList);
	}

	public void filtCategories(String categories) {
		List<Item> itemList = myModel.filtCategories(myUser, categories);
		myView.advanceFilter(itemList);
	}

	public void filtDate(String date) {
		List<Item> itemList = myModel.filtDate(myUser, date);
		myView.advanceFilter(itemList);
	}

}
